#!/usr/bin/env python
# -*- coding: utf-8 -*-

import codecs

with codecs.open('test.txt', 'r') as f:
    for line in f:
        print(line, end='')

f = open('test.txt', 'r')
from collections import Iterable,Iterator
print(isinstance(f,Iterator))
print(isinstance(f,Iterable))
print(next(f))
f.close()